﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace ConnerA1P1
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : IService1
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }
        
        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }

        //**********************************************************************************************
        //*
        //*  Return the value of PI
        //*
        //**********************************************************************************************

        public double PiValue()
        {
            return System.Math.PI;
        }

        //**********************************************************************************************
        //*
        //*  Return the absolute value of the input integer
        //*
        //**********************************************************************************************

        public int absValue(int intVal)
        {
            return System.Math.Abs(intVal);
        }

        //**********************************************************************************************
        //*
        //*  Add the two input numbers n1 and n2 and return the result
        //*
        //**********************************************************************************************

        public double add(double n1, double n2)
        {
            return n1 + n2;
        }

        //**********************************************************************************************
        //*
        //*  Return the result of subtracting n2 from n1
        //*
        //**********************************************************************************************

        public double subtract(double n1, double n2)
        {
            return n1 - n2;
        }
    }
}
